import Vue from 'vue'
import Router from 'vue-router'
import Test from '@/containers/Test.vue'
import Detail from '@/containers/Detail.vue'
import Information from '@/containers/Information.vue'

Vue.use(Router)
// let id='1';//路由导航，根据传递过来的值就行路由跳转
export default new Router({
  routes: [
    {
      path: '/',
      redirect:'/detail',
      // beforeEnter(to, from, next) {
      //   if(id=='1'){
      //     next({ name: "Detail" })
      //   }else{
      //     next({ name: "Information" })
      //   }
      // }
    },
    {
      path: '/test',
      name: 'Test',
      component: Test
    },
    {
      path: '/detail',
      name: 'Detail',
      component: Detail
    },
    {
      path: '/information',
      name: 'Information',
      component: Information
    }
  ]
})
